/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author YDZ
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';

const { adminPath } = useGlobSetting();

export interface PmMaterialneed extends BasicModel<PmMaterialneed> {
  name?: string; // 工程名称
  createtime?: string; // 创建时间
  projectno?: string; // 工程编码
  sno?: string; // 设计变更编号
  fdno?: string; // 分单编号
  submittime?: string; // 提交时间
  needdate?: string; // 需求时间
  ffile?: string; // ffile
  checker?: string; // 审核人
  checktime?: string; // 审核时间
  needorreceive?: number; // 计划/收货
  remark?: string; // remark
  notedate?: string; // 通知送货时间
  noteremark?: string; // 送货备注
  noteoper?: string; // noteoper
  noteoptime?: string; // 通知送货操作时间
  isreceive?: number; // isreceive
  notepic?: string; // notepic
  pmMaterialneedsList?: any[]; // 子表列表
}

export const pmMaterialneedList = (params?: PmMaterialneed | any) =>
  defHttp.get<PmMaterialneed>({ url: adminPath + '/material/need/pmMaterialneed/list', params });

export const pmMaterialneedListData = (params?: PmMaterialneed | any) =>
  defHttp.post<Page<PmMaterialneed>>({
    url: adminPath + '/material/need/pmMaterialneed/listData',
    params,
  });

export const pmMaterialneedForm = (params?: PmMaterialneed | any) =>
  defHttp.get<PmMaterialneed>({ url: adminPath + '/material/need/pmMaterialneed/form', params });

export const pmMaterialneedSave = (params?: any, data?: PmMaterialneed | any) =>
  defHttp.postJson<PmMaterialneed>({
    url: adminPath + '/material/need/pmMaterialneed/save',
    params,
    data,
  });

export const pmMaterialneedDelete = (params?: PmMaterialneed | any) =>
  defHttp.get<PmMaterialneed>({ url: adminPath + '/material/need/pmMaterialneed/delete', params });

export const pmMaterialneedNotcie = (params?: any, data?: PmMaterialneed | any) =>
  defHttp.postJson<PmMaterialneed>({
    url: adminPath + '/material/need/pmMaterialneed/notice',
    params,
    data,
  });


export const pmMaterialneedSelect = (params?: PmMaterialneed | any) =>
  defHttp.post<Page<PmMaterialneed>>({
    url: adminPath + '/material/need/pmMaterialneed/needSelect',
    params,
  });

  export const pmMaterialneedgetNeedDetail = (params?: PmMaterialneed | any) =>
  defHttp.get<PmMaterialneed>({ url: adminPath + '/material/need/pmMaterialneed/getNeedDetail', params });